package com.admore.demo.util;

import android.content.Context;
import android.util.DisplayMetrics;

/**
 * Created by bytedance on 2019/9/5.
 */

public class UIUtils {

    public static int getScreenWidth(Context context) {
        DisplayMetrics dm = context.getResources().getDisplayMetrics();
        return dm.widthPixels;
    }

    public static int getScreenWidthDp(Context context) {
        DisplayMetrics dm = context.getResources().getDisplayMetrics();
        return (int) (dm.widthPixels/dm.density);
    }

    public static int getScreenHeight(Context context) {
        DisplayMetrics dm = context.getResources().getDisplayMetrics();
        return dm.heightPixels;
    }

    public static String getCurrProcessName(Context context) {
        return context.getPackageName();
    }
}
